import request from '@/utils/request'

// 获取部门列表
export function getDepartments() {
    return request({
        url: '/company/department',
        method: 'get'
    })
}

// 根据ID删除部门
export function delDepartment(depID) {
    return request({
        url: `/company/department/${depID}`,
        method: 'DELETE'
    })
}

// 新增部门
export function addDepartment(data) {
    return request({
        url: '/company/department',
        method: 'POST',
        data: data
    })
}

// 根据id编辑部门
export function updDepartment(depID, data) {
    return request({
        url: `/company/department/${depID}`,
        method: 'PUT',
        data: data
    })
}

// 根据id查询部门详情
export function getDeptDetail(depID) {
    return request({
        url: `/company/department/${depID}`,
        method: 'GET'
    })
}